import request from '@/utils/request'

// 查询团队，针对客户或商机进行服务列表
export function listTeam(query) {
  return request({
    url: '/crm/team/list',
    method: 'get',
    params: query
  })
}

// 查询团队，针对客户或商机进行服务详细
export function getTeam(id) {
  return request({
    url: '/crm/team/' + id,
    method: 'get'
  })
}

// 新增团队，针对客户或商机进行服务
export function addTeam(data) {
  return request({
    url: '/crm/team',
    method: 'post',
    data: data
  })
}

// 修改团队，针对客户或商机进行服务
export function updateTeam(data) {
  return request({
    url: '/crm/team',
    method: 'put',
    data: data
  })
}

// 删除团队，针对客户或商机进行服务
export function delTeam(id) {
  return request({
    url: '/crm/team/' + id,
    method: 'delete'
  })
}

// 导出团队，针对客户或商机进行服务
export function exportTeam(query) {
  return request({
    url: '/crm/team/export',
    method: 'get',
    params: query
  })
}

//获取不在此团队的所有人员
export function getNotTeamUser(query) {
  return request({
    url: '/crm/team/getNotTeamUser',
    method: 'get',
    params: query
  })
}